<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>    
    <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>    
    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>

    <style>
        .navbar{
            width: 100%;
            height: 66px;
        }
        .nav-pills{
            float: left;
            width: 40%;
            height: 66px;
            line-height: 51px;
            margin: 0 auto;
        }
        .nav-pills>li{
            text-align: center;
            list-style: none;
            /* width: 4rem; */
            float: left;
        }
        .nav-link{
            display: inline-block;
            /* width: 4rem; */
            color: rgb(255, 255, 255);
            font-weight: bold;
        }
        .nav-pills .nav-link.active, .nav-pills .show>.nav-link{
            color: rgb(221, 220, 220);
            background-color: #2badf8;
        }
        .imgbox{
            width: 60%;
            height: 66px;
            float: left;
        }
        .key{
            width: 16px;
            font-size: 16px;
            margin-left: 10px;
        }
        .login>a{
            color: rgb(255, 255, 255);
            text-decoration: none;
        }
        .tou{
            width: 63px;
            height: 63px;
            margin-top: 1px;
            border-radius: 50%;
            border: 1px rgb(147, 144, 144) solid;
            float: left;
        }
        .img{
            width: 180px;
            height: 66px;
            float: left;
            padding-right: 20px;
            margin-left: 120px;
        }
        .cotent{
            width: 1200px;
            height: 100vh;
            margin: 15px auto;
            display: flex;
            justify-content: center;
        }
        .contents{
            display: inline-block;
            border: 1px solid #59f7ff;
        }
        .left{
            width: 800px;
            height: 700px;
            background: white;
        }
        .right{
            width: 350px;
            height: 700px;
            margin-left: 45px;
            align-items: flex-start;
        }
        .box{
            background: rgba(0, 0, 0, 0.5) url(./imge/2.png) no-repeat;
            background-size: 100% 100%;
            opacity: 0.8;
        }
        .serch{
            margin-top: 1px;
            height: 60px;
            width: 100%;
            display: flex;
            align-items: center;
            background: rgba(239, 244, 255, 1);
        }
        .serchbox{
            display: inline-block;
        }
        .serch_left{
            width: 74%;
            display: flex;
            justify-content: center;
            align-items: center;
            
        }
        .serch_right{
            width: 26%;
            margin-left: -1.5%;

        }

        .articl{
            color: #2badf8;
            line-height: 60px;
            padding: 2px 20px;
        }
        .form-inline{
            display: inline-block;
        }
        .mb-2{
            background: rgba(172, 220, 248, 0.2);
            color: rgb(255, 255, 255);
            border-radius: 5px;
            border: 1px #7a99d7 solid;
        }
        input::-webkit-input-placeholder{
            color: #829fdc;
        }
        .btn-primary{
            margin-top: 1px;
            height: 28px;
            line-height: 2px;
            color: #829fdc;
        }
        .arthead{
             margin: 0;
            display: flex;
            justify-content: left;
            align-items: center;
            list-style: none;
        }
        article>nav>ul>li{
            width: 5.5rem;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        article>nav>ul>li>a{
            color: rgb(0, 160, 218);
            text-decoration: none;
            font-size: 1rem;
        }   
        a{
            text-decoration: none;
            color: black;
        }
        a:hover{
            color: #ff6136;
            text-decoration: none;
        }
        .big_myarticleright{
            width: 45%;
            margin-left: 2rem
        }
        .myarticle{
            height: 20rem;
            width: 100%;
            margin-bottom: 0.5rem;
            background-color:rgba(255, 255, 255,0) ;
        }
       .myoutlay{
            display: flex;
            justify-content: center;
            align-items: center;
       }
       .remen>ul{
            width: 96%;
            padding-left: 0px;
            margin: 0 auto;

       }
       .remen>ul>li{
            display: flex;
            list-style: none;
            height: 2rem;
            line-height: 2rem;
            font-size: 0.9rem;
            opacity: 0.8;
            /* background-color: #04e1ed; */
            /* margin-top: 1px; */
       }
       .remen>ul>li>a{
            width: 60%;
            list-style: none;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-right: 2rem;
            /* background-color: #04e1ed; */
       }
       .remen>ul>li>b{
            font-size: 0.7rem;
            font-weight: 400;
            opacity: 0.8;
            color: #cf6e44;
       }
       .remen>ul>li>span{
            text-align: center;
            margin-top: 0.2rem;
            line-height: 26px;
            margin-right: 5px;
            display: inline-block;
            border-radius: 13px;
            width: 26px;
            height: 26px;
            background-color:#d0d0d0;
       }
       .remen>ul>li>i>img{
        margin-top: 0.5rem;
            width: 0.6rem;
            opacity: 0.5;
       }
       .footer{
            width: 100%;
            height: 150px;
            background-color: #e3e3e3;
            text-align: center;
            padding: 0.9rem 0;
            font-size: 0.7rem;
       }  
       .big_article>ul{
        margin-top: -0.2rem;
            padding-left: 10px;
            width: 100%;
            height: 8rem;
            border-bottom: 1px #d5d5d5 solid;
       }
       .big_article>ul>li{
            width: 100%;
            height: 1rem;
            margin-top: 1rem;
            list-style: none;
            opacity: 0.7;
            font-size: 0.8rem;
            /* background-color: #ff6136; */
       }
       .big_article>ul>li>a{
        color: #078edb;
       }
       .big_article>ul>li>span{
        margin-right: 1rem;
       }
       .page-link{
            background-color: #c6caca;
       }
       .dropdown-toggle{
            height: 30px;
            line-height: 16px;
            background-color: rgb(180, 217, 227);
            color: rgb(81, 80, 80);
            font-weight: 600;
       }
       .dropdown-item{
            height: 2rem;
            font-size: 0.8rem;
            line-height: 1.5rem;
            /* border-bottom: 1px rgb(176, 174, 174) solid; */
       }
       #searchbigbox{
            z-index: 99999;
            position: absolute;
            width: 900px;
            background-color: rgb(163, 152, 152);
            left: 300px;
            overflow: auto;
            min-height: 50px;
            max-height: 80%;
       }
       #searchbigbox>ul{
            padding: 1rem;
            padding-top: 0;
            padding-right: 2rem;
            width: 100%;
            min-height: 50px;
            max-height: 80%;
            /* background-color: #04e1ed; */
       }
       #searchbigbox>ul>div>li{
            list-style: none;
            width: 100%;
            line-height: 2rem;
            height: 2rem;
            margin-bottom: 5px;
            border-bottom: 1px rgba(196, 194, 194, 0.455) dashed;
       }
       #searchbigbox>ul>div>li>span{
            width: 10rem;
            text-align: center;
            height: 2rem;
            color: white;
            text-overflow: ellipsis;
            overflow: hidden;
            display: inline-block;
            /* background-color: #04e1ed; */
       }
       #searchbigbox>ul>div>li>span>a{
            color: #59f7ff;
       }
       #searchbigbox>ul>div>li>span>a:hover{
            color: #ff6136;
            text-decoration: none;
        }
       #close_span{
            display: inline-block;
            margin-bottom: 10px;
            color: aliceblue;
            width: 100%;
       }
       #close{
            float: right;
            width: 2rem;
            height: 1rem;
            margin-right: -2rem;
            line-height: 0.5rem;
            text-align: center;
            font-size: 0.5rem;
       }
       #insertInfo>li>span{
            margin-right: 5px;
       }
       .actives{
            background-color: #2badf8;
        }
    </style>
</head>
<body>
    <div class="modal fade" id="myLogin">
        <div class="modal-dialog">
          <div class="modal-content">
       
            <!-- 模态框头部 -->
            <div class="modal-header">
              <h4 class="modal-title"> 用户登录 </h4>
              <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
       
            <!-- 模态框主体 -->
            <div class="modal-body">
                <form action="" method="post">
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入电话 </span>
                        </div>
                        <input type="text" class="form-control" placeholder="Userphone" id="uPhone" name="">
                    </div>
                    <span  class="massge" id="lo_phone"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入密码 </span>
                        </div>
                        <input type="password" class="form-control" placeholder="Userpassword" id="uPass" name="">
                    </div>
                    <span  class="massge" id="lo_pass"></span>
                </form>
            </div>
       
            <!-- 模态框底部 -->
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" id="login"> 登 录 </button>
            </div>
       
          </div>
        </div>
    </div>
    <script>
        $("#login").click(function(){
            var userPhone = $("#uPhone").val();
            var userPass = $("#uPass").val();
            var flag = true;
            var myreg=myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;
            var message = "";
            if(userPhone == ''){
                message = "手机号码不能为空！";
                $('#lo_phone').text(message);
                return flag = false
            }else{
                $('#lo_phone').text('')
            }
            if(userPhone.length !=11){
                message = "请输入有效的手机号码！";
                $('#lo_phone').text(message);
                return flag = false
            }else{
                $('#lo_phone').text('')
            } 
            if(!myreg.test(userPhone)){
                message = "请输入有效的手机号码！";
                $('#lo_phone').text(message);
                return flag = false
            }else{
                $('#lo_phone').text('')
            }
            if(userPass == ''){
                message = "密码不能为空！";
                $('#lo_pass').text(message);
                return flag = false
            }else{
                $('#lo_pass').text('');
            }
            if(flag == true){
                $.ajax({
                    url: "http://cms.com:8081/index/index/userLogin",
                    type: "POST",
                    data: {
                        userPhone,
                        userPass
                    },
                    success: function (data) {
                        if(data == 3){
                            alert('账号已被禁用！');
                            window.location.reload()
                            return
                        }
                        if(data == 0){
                            alert('还没有注册！');
                            window.location.reload()
                            return
                        }
                        if(data == 2){
                            alert('账号或密码错误！');
                            window.location.reload()
                            return
                        }else{
                            var name = JSON.parse(data)
                            $("#userName").text(name.val.userName)
                            localStorage.setItem('void',name.key)
                            window.location.reload()
                            // console.log(name)
                        }
                    }
                }); 
            }
             
        })
    
        function init(){
            var res = localStorage.getItem('void');
            if(res != ''){
                $.ajax({
                    url: "http://cms.com:8081/index/index/getUserInfo",
                    type: "POST",
                    data: {
                        res
                    },
                    success: function (data) {
                        if(data != 0){
                            var name = JSON.parse(data)
                            $("#userName").text(name.userName)
                            $("#del").remove()
                        } 
                    }
                });
            }
        }
        init()
    
        function mian(){
            var res = localStorage.getItem('void');
            if(res != ''){
                $.ajax({
                    url: "http://cms.com:8081/index/index/delUserInfo",
                    type: "POST",
                    data: {
                        res
                    },
                    success: function (data) {
                        if(data == 0){
                            alert('没有登录，快去登录！')
                            console.log(data)
                        }else{
                            var name = JSON.parse(data)
                            $("#userName").text(name.userName)
                            localStorage.removeItem('void')
                            alert('退出成功！')
                            window.location.reload()
                        }
                        
                    }
                });
            }
        }
        getAavatar()
        function getAavatar(){
            var res = localStorage.getItem('void');
            if(res != null){
                $.ajax({
                    url:"http://cms.com:8081/index/index/getAavatar",
                    type:"POST",
                    data:{
                        redis:res
                    },
                    success:function(data){
                        var res = JSON.parse(data)
                        // console.log(res)
                        if(res.useAavatar != null){
                            $("#tou").attr('src','')
                            $("#tou").attr('src','http://cms.com:8081/../static/uploads/'+res.useAavatar)
                        }
                    }
                });
            }
            
        }
    </script>
    <!-- 注册 -->
    <div class="modal fade" id="mySign">
        <div class="modal-dialog">
          <div class="modal-content">
       
            <!-- 模态框头部 -->
            <div class="modal-header">
              <h4 class="modal-title"> 用户注册 </h4>
              <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
       
            <!-- 模态框主体 -->
            <div class="modal-body">
                <form action="" method="post">
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入电话 </span>
                        </div>
                        <input type="text" class="form-control" placeholder="Userphone" id="phone" name="">
                    </div>
                    <span  class="massge" id="ph_phone"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入昵称 </span>
                        </div>
                        <input type="text" class="form-control" placeholder="Username" id="name" name="">
                    </div>
                    <span  class="massge" id="na_name"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入密码 </span>
                        </div>
                        <input type="password" class="form-control" placeholder="Userpassword" id="pass" name="">
                    </div>
                    <span  class="massge" id="pa_pass"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 确认密码 </span>
                        </div>
                        <input type="password" class="form-control" placeholder="Userpassword" id="repass" name="">
                    </div>
                    <span  class="massge" id="re_pass"></span>
                </form>
            </div>
       
            <!-- 模态框底部 -->
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" id="sign"> 注 册 </button>
            </div>
       
          </div>
        </div>
    </div>
    <script>
        $("#sign").click(function(){
            var userPhone = $("#phone").val();
            var userName = $("#name").val();
            var userPass = $("#pass").val();
            var userRePass = $("#repass").val();
            var flag = true;
            var myreg=myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;
            var message = "";
            if(userPhone == ''){
                message = "手机号码不能为空！";
                $('#ph_phone').text(message);
                return flag = false
            }else{
                $('#ph_phone').text('')
            }
            if(userPhone.length !=11){
                message = "请输入有效的手机号码！";
                $('#ph_phone').text(message);
                return flag = false
            }else{
                $('#ph_phone').text('')
            } 
            if(!myreg.test(userPhone)){
                message = "请输入有效的手机号码！";
                $('#ph_phone').text(message);
                return flag = false
            }else{
                $('#ph_phone').text('')
            }
            if(userName == ''){
                message = "昵称不能为空！";
                $('#na_name').text(message);
                return flag = false
            }else{
                $('#na_name').text('')
            } 
            if(userName.length <2){
                message = "昵称不能小于两个字！";
                $('#na_name').text(message);
                return flag = false
            }else{
                $('#na_name').text('')
            } 
            if(userName.length >5){
                message = "昵称不能多于5个字！";
                $('#na_name').text(message);
                return flag = false
            }else{
                $('#na_name').text('')
            } 
            if(userPass == ''){
                message = "密码不能为空！";
                $('#pa_pass').text(message);
                return flag = false
            }else{
                $('#pa_pass').text('');
            } 
            if(userPass.length <6){
                message = "密码不能少于6位数！";
                $('#pa_pass').text(message);
                return flag = false
            }else{
                $('#pa_pass').text('');
            } 
            if(userPass == ''){
                message = "请再次确认密码！";
                $('#re_pass').text(message);
                return flag = false
            }else{
                $('#re_pass').text('');
            } 
            if(userPass != userRePass){
                message = "两次输入的密码不相同！";
                $('#re_pass').text(message);
                return flag = false
            }else{
                $('#re_pass').text('');
            }
            if(flag == true){
               $.ajax({
                    url: "http://cms.com:8081/index/index/userSign",
                    type: "POST",
                    data: {
                        userPhone,
                        userName,
                        userPass
                    },
                    success: function (data) {
                        if(data==0){
                            alert('已有账号！')
                            window.location.reload()
                            return
                        }
                        if(data==1){
                            alert('注册成功！')
                            window.location.reload()
                        }else{
                            alert('注册失败！')
                            window.location.reload()
                        }
                    }
                }); 
            }
            
        })
    </script>
<div class="box">
    <header>
        <nav class="navbar navbar-expand-sm" style="background-color:rgb(114, 190, 234);font-size: 16px;">
            <div class="imgbox">
                <img class="img" src="./imge/logo1.png" alt="">
                <ul class="nav nav-pills" role="tablist" id="tablist">
                    <!-- <li class="nav-item">
                        <a class="nav-link active" href="index.html">文章</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#menu1">散文</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#menu2">诗词</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#menu2">小说</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#menu2">其他</a>
                    </li> -->
                </ul>
            </div>
            <div class="login" style="width: 28%; font-size: 16px;float: right;height: 66px;">
                <img src="./imge/0.png" alt="" class="tou" id="tou">
                <div style="float: left; width: 6rem;text-align: center; line-height: 66px;">
                    <div class="dropdown" style="margin-left: 1rem;">
                        <span type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="userName">
                          
                        </span>
                        <div class="dropdown-menu" style="background-color:rgb(215, 236, 247); padding-bottom: 0;" id="bacLogin">
                          <!-- <a href="javascript:;" class="dropdown-item" >修改密码</a>
                          <a href="javascript:;" class="dropdown-item" >上传头像</a> -->
                          <a href="userinfo.html" class="dropdown-item" >个人信息</a>
                          <span id="deLogin" onclick="mian()" class="dropdown-item" style="border-top: 1px rgb(123, 122, 122) solid;">退出登录</span>
                        </div>
                    </div>
                </div>
                <div style="width: 50%;float:right;line-height: 66px;">
                    <img src="./imge/write.png" alt="" class="key"><a href="dome.html">写文章</a>
                    <span id="del"><img src="./imge/钥匙2_key-two.png" alt="" class="key"><a href="javascript:;" data-toggle="modal" data-target="#myLogin"> 登录</a></span> 
                    <img src="./imge/创建_newlybuild.png" alt="" class="key key2"><a href="javascript:;" data-toggle="modal" data-target="#mySign"> 注册</a> 
                </div>
            </div>
          </nav>
    </header>
    <div class="serch">
        <div class="serchbox serch_left">
            <a class="articl" href="">经典美文</a>
            <a class="articl" href="">情感文章</a>
            <a class="articl" href="">散文随笔</a>
            <a class="articl" href="">生活随笔</a>
            <a class="articl" href="">心情日记</a>
            <a class="articl" href="">现代诗歌</a>
            <a class="articl" href="">古词风韵</a>
            <a class="articl" href="">爱情故事</a>
        </div>
        <div class="serchbox serch_right">
            <form class="form-inline" action="/action_page.php">
                <input type="text" class="mb-2 mr-sm-2" id="keywords" placeholder="请输入内容..." name="">   
                <button type="button" class="btn btn-primary mb-2" onclick="searchbox()">搜索</button>
            </form>
        </div>
       
    </div>
    <div id="searchbigbox" style="display: none;">
        <ul>
             <span id="close_span">一共为你查询到[ <u id="result"></u> ]个结果<button id="close">X</button></span>
             <div>
                 <li style="border-bottom: 1px white solid;">
                     <span style="width: 2rem;">序号</span>
                     <span>文章类型</span>
                     <span style="width: 12rem;">文章标题</span>
                     <span style="width: 12rem;">文章作者</span>
                     <span style="width: 4rem;">阅读量</span>
                     <span>发布时间</span>
                 </li>
             </div>
             <div id="insertInfo">
                 
             </div>  
        </ul>
     </div>
    <div class="cotent">
        <article style="height:100%;width: 68%;background-color: rgba(239, 244, 255, 0.9);padding: 0 1rem;overflow: auto;display:flex;flex-direction: column;justify-content: flex-start;align-items: center;border: 1px #04e1ed solid;">
            <nav style="width: 100%;display: flex;justify-content:flex-start;align-items: center;border-bottom: 1px rgb(214, 214, 214) solid;height:50px;margin-bottom: 0.5rem;margin-top: 2rem;background-color: #c1c1c2;">
                <span style="width: 15%;font-size: 1.5rem;border-right: 1px rgb(212, 212, 212) solid;height: 100%;opacity: 0.6;" class="myoutlay" id="myoutlay">经典文章</span>
                <ul class="arthead">
                    
                </ul>
            </nav>
            <div style="flex-direction: row;width: 100%;justify-content: center;" class="big_article" id="big_art">
                <!-- <ul>
                    <li style="font-size: 0.9rem;color: #1991d7;font-weight: bold;"><a href="about.html">景山讲道集.基督徒素质考（2）</a></li>
                    <li style="height: 3rem;font-weight: bold;">基督徒第二个素质：对待钱财的态度：不因钱财的缺乏而导致惊慌失措的情况发生，不将钱财的获得视为凭自己的努力而应得，树立钱财为神所赐的观念，不受属世钱财观念的诱惑而与世人一道做钱财的奴隶。如 ...</li>
                    <li style="font-size: 0.7rem;"><span>发表时间：2022-09-16</span><span>用户：景山哥哥</span><span>阅读：112</span></li>
                </ul> -->
            </div>
            
        </article>
        
        <aside style="height:100%;width:32%;background-color: rgba(239, 244, 255, 0.9);margin-left: 15px;border: 1px #04e1ed solid;">
            <div style="height: 37px;color: #2badf8;" class="myoutlay">
                <span> ————本站热门文章———— </span>
            </div>
            <div class="remen">
                <ul id="hotdoor">
                    
                </ul>
                
            </div>

            <div style="height: 37px;color: #2badf8;" class="myoutlay">
                <span> ————读者推荐文章———— </span>
            </div>
            <div class="remen">
                <ul id="push">
                    
                </ul>
                
            </div>
        </aside>
    </div>
    <div class="footer">
        <p style="font-size: 0.9rem;"> 网站首页 | 关于网站 | 网站地图 </p>
        <p>文字站感谢每一位喜欢本站的人，欢迎将本站分享给你的朋友！最温暖的文字记录站 ─ 文字站！</p>
        <p>本站部分内容来源于互联网，若无意侵犯您的权利，请联系我们及时删除</p>
        <p style="font-size: 0.9rem;">渝ICP备99999999号  Copyright © 2015  文字站   www.xiaowumeiwen.com  版权所有</p>
    </div>
</div>
<script>
    $("#close").click(function(){
        $("#searchbigbox").css('display','none')
    });
    function searchbox(){
        $("#searchbigbox").css('display','block');
        var res = $("#keywords").val()
        $("#insertInfo").empty()
        $.ajax({
            url:"http://cms.com:8081/index/index/search",
            type:'POST',
            data:{keywords:res},
            success:function(e){
                var data = JSON.parse(e)
                var num = data.length
                if(data.length != 0){
                    $("#result").text(num)
                    for(var i=0;i<num;i++){
                       var $span = '<li >'+
                                    '<span style="width: 2rem;">'+(i+1)+'</span>'+
                                    '<span>'+data[i].articleType[0].typName+'</span>'+
                                    '<span style="width: 12rem;"><a href="about.html?id='+data[i].artID+'">'+data[i].artTitle+'</a></span>'+
                                    '<span style="width: 12rem;">'+data[i].artAuthor+'</span>'+
                                    '<span style="width: 4rem;">'+data[i].readNum+'</span>'+
                                    '<span>'+data[i].dateline+'</span>'+
                                '</li>'
                        $("#insertInfo").append($span) 
                    }
                    
                }else{
                    $("#result").text(num)
                }
            }
        })
    }
</script>
<script>
    
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg); //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }
    function getArtList(){
        var id = getUrlParam('tid')
        $.ajax({
            url: "http://cms.com:8081/index/index/getArticle",
            type: "POST",
            success: function (res) {
                data = JSON.parse(res)
                // console.log(data)
                for(var i=0;i<data.length;i++){
                    var $div = "<li onclick='numb("+i+")' class='nav-item'><a class='nav-link' id='index_"+data[i].typID+"' href='index.html'>"+data[i].typName+"</a></li>"
                    $("#tablist").append($div)
                }
            }
        });
        $.ajax({
            url: "http://cms.com:8081/index/index/articleList",
            type: "POST",
            data: {id},
            success: function (res) {
                var data = JSON.parse(res)
                for(var i=0;i<data.data.length;i++){
                    var ul = '<ul>'+
                                '<li style="font-size: 0.9rem;color: #1991d7;font-weight: bold;"><a href="about.html?id='+data.data[i].artID+'">'+data.data[i].artTitle+'</a></li>'+
                                '<li style="height: 2.2rem;font-weight: bold;overflow: hidden;text-overflow: ellipsis;line-clamp:2;-webkit-line-clamp:2;display:-webkit-box;">'+data.data[i].artContent+'</li>'+
                                '<li style="font-size: 0.7rem;"><span>'+data.data[i].dateline+'</span><span>作者：<a href="author.html?uid='+data.data[i].uID+'">'+data.data[i].artAuthor+'</a></span><span>阅读：'+data.data[i].readNum+'</span></li>'+
                            '</ul>'
                            $("#big_art").append(ul) 
                }
                $("#myoutlay").text(data.res.typName)
            }
        });

        $.ajax({
            url: "http://cms.com:8081/index/index/articleHot",
            type: "POST",
            success: function (res1) {
                $("#hotdoor").empty()
                $("#push").empty()
                res = JSON.parse(res1)
                // console.log(res)
                for(var i=0;i<10;i++){
                    if(i==0){
                        var div = '<li><i><img src="./imge/right.png" alt=""></i><span style="background-color: red;">'+(i+1)+'</span><a href="about.html?id='+res.data[i].artID+'">'+res.data[i].artTitle+'</a><b>阅读('+res.data[i].readNum+')</b></li>'
                    }else if(i==1){
                        var div = '<li><i><img src="./imge/right.png" alt=""></i><span style="background-color: #ff6136;">'+(i+1)+'</span><a href="about.html?id='+res.data[i].artID+'">'+res.data[i].artTitle+'</a><b>阅读('+res.data[i].readNum+')</b></li>'
                    }else if(i==2){
                        var div = '<li><i><img src="./imge/right.png" alt=""></i><span style="background-color: #ff6136;">'+(i+1)+'</span><a href="about.html?id='+res.data[i].artID+'">'+res.data[i].artTitle+'</a><b>阅读('+res.data[i].readNum+')</b></li>'
                    }else{
                        var div = '<li><i><img src="./imge/right.png" alt=""></i><span>'+(i+1)+'</span><a href="about.html?id='+res.data[i].artID+'">'+res.data[i].artTitle+'</a><b>阅读('+res.data[i].readNum+')</b></li>'
                    }
                    $("#hotdoor").append(div) 
                }
                for(var j=0;j<10;j++){
                    var li = '<li><i><img src="./imge/right.png" alt=""></i><span>'+(j+1)+'</span><a href="about.html?id='+res.res[j].artID+'">'+res.res[j].artTitle+'</a><b>推荐('+res.res[j].pushNum+')</b></li>'
                    $("#push").append(li)
                }
            }
        });
            
    }
    getArtList()
</script>
<style>
    

</style>
</body>
</html>